/**************************************************************************
/* This class adds all the GS methods to an Operation.
/*
/* Copyright (c) 2009 by Bernhard Bablok (mail@bablokb.de)
/*
/* This program is free software; you can redistribute it and/or modify
/* it under the terms of the GNU Library General Public License as published
/* by  the Free Software Foundation; either version 2 of the License or
/* (at your option) any later version.
/*
/* This program is distributed in the hope that it will be useful, but
/* WITHOUT ANY WARRANTY; without even the implied warranty of
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
/* GNU Library General Public License for more details.
/*
/* You should have received a copy of the GNU Library General Public License
/* along with this program; see the file COPYING.LIB.  If not, write to
/* the Free Software Foundation Inc., 59 Temple Place - Suite 330,
/* Boston, MA  02111-1307 USA
/**************************************************************************/

package org.im4java.core;

/**
   This class subclasses Operation and adds methods for all commandline
   options of gs.

   <p>This class is automatically generated by the source-code generator of
   im4java.</p>

   @version $Revision: 1.14 $
   @author  $Author: bablokb $
*/

public class GSOps extends Operation {

  //////////////////////////////////////////////////////////////////////////////

  /**
     The protected Constructor. You should only use subclasses of GSOps.
  */

  protected GSOps() {
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -v to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps version() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-v");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dAlignToPixels= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps alignToPixels(Integer size) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dAlignToPixels=");

    if (size != null) {
      buf.append(size.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dBackgroundColor= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pngAlphaBackgroundColor(String color) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dBackgroundColor=");

    if (color != null) {
      buf.append(color.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dBufferSpace= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps bufferSpace(Integer space) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dBufferSpace=");

    if (space != null) {
      buf.append(space.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dDEVICEWIDTHPOINTS= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps deviceWidthPoints(Integer width) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dDEVICEWIDTHPOINTS=");

    if (width != null) {
      buf.append(width.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dDEVICEHEIGHTPOINTS= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps deviceHeightPoints(Integer height) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dDEVICEHEIGHTPOINTS=");

    if (height != null) {
      buf.append(height.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dEPSCrop to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps epsCrop() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dEPSCrop");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dEPSFitPage to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps epsFitPage() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dEPSFitPage");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dFirstPage= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pdfFirstPage(Integer page) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dFirstPage=");

    if (page != null) {
      buf.append(page.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dFIXEDMEDIA to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps fixedMedia() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dFIXEDMEDIA");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dLastPage= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pdfLastPage(Integer page) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dLastPage=");

    if (page != null) {
      buf.append(page.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dMaxBitmap= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps maxBitmap(Integer size) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dMaxBitmap=");

    if (size != null) {
      buf.append(size.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dNumRenderingThreads= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps numRenderingThreads(Integer number) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dNumRenderingThreads=");

    if (number != null) {
      buf.append(number.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dPDFFitPage to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pdfFitPage() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dPDFFitPage");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dPDFSETTINGS= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pdfSettings(String settingsEnum) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dPDFSETTINGS=");

    if (settingsEnum != null) {
      buf.append(settingsEnum.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dPrinted to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps usePdfPrintOptions() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dPrinted");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dPrinted=false to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps usePdfScreenOptions() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dPrinted=false");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dTextAlphaBits= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps textAlphaBits(Integer bits) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dTextAlphaBits=");

    if (bits != null) {
      buf.append(bits.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dShowAnnots=false to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pdfIgnoreAnnots() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dShowAnnots=false");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dGraphicsAlphaBits= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps graphicsAlphaBits(Integer bits) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-dGraphicsAlphaBits=");

    if (bits != null) {
      buf.append(bits.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dQUIET to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps quiet() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dQUIET");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dUseCropBox to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps usePdfCropBox() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dUseCropBox");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -dUseTrimBox to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps usePdfTrimBox() {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-dUseTrimBox");

    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -o to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps outputFile(String outputFile) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    iCmdArgs.add("-o");

    if (outputFile != null) {
      buf.append(outputFile.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -sPDFPassword= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps pdfPassword(String password) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-sPDFPassword=");

    if (password != null) {
      buf.append(password.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -sDEVICE= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps outputDevice(String deviceName) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-sDEVICE=");

    if (deviceName != null) {
      buf.append(deviceName.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -sFONTPATH= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps fontPath(String paths) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-sFONTPATH=");

    if (paths != null) {
      buf.append(paths.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -sPAPERSIZE= to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps paperSize(String size) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-sPAPERSIZE=");

    if (size != null) {
      buf.append(size.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }

  //////////////////////////////////////////////////////////////////////////////

  /**
     Add option -r to the gs commandline
     (see the documentation of gs for details).
  */

  public GSOps resolution(Double density) {

    String       oper;                      // only used in some methods
    StringBuffer buf = new StringBuffer();  // local buffer for option-args
    buf.append("-r");

    if (density != null) {
      buf.append(density.toString());
    }
    if (buf.length()>0) {
      iCmdArgs.add(buf.toString());
    }
    return this;
  }


}
